create  table jms_dm.dm_qxt_customer_new_detail_dt
(
date_time         date COMMENT '业务日期' ,
agent_code              varchar(100) COMMENT '代理区编码' ,
fran_code               varchar(100) COMMENT '加盟商编码' ,
code                    varchar(100) COMMENT '网点编码' ,
ordersource_code        varchar(100) COMMENT '平台code' ,
ordersource_name        varchar(100) COMMENT '平台' ,
customer_province_id    varchar(100) COMMENT '客户所属省id' ,
customer_province_desc  varchar(100) COMMENT '客户所属省' ,
customer_city_id        varchar(100) COMMENT '客户所属城市id' ,
customer_city_desc      varchar(100) COMMENT '客户所属城市' ,
customer_area_id        varchar(100) COMMENT '客户所属区县id' ,
customer_area_desc      varchar(100) COMMENT '客户所属区县' ,
agent_name              varchar(100) COMMENT '代理区名字' ,
fran_name               varchar(100) COMMENT '加盟商名字' ,
name                    varchar(100) COMMENT '网点名字' ,
customer_code           varchar(100) COMMENT '客户编码' ,
customer_name           varchar(100) COMMENT '客户名字' ,
mall_id                 varchar(100) COMMENT '商家ID' ,
mall_name               varchar(100) COMMENT '商家名字' ,
customer_signed_date  date COMMENT '客户签约日期' ,
day_customer_waybill_sum   bigint COMMENT '运单总量'
)
ENGINE=OLAP
DUPLICATE KEY(date_time,agent_code,fran_code,code)
comment '七星潭新增客户明细'
PARTITION BY RANGE (date_time) (
   START ("2022-09-27") END ("2022-11-26") EVERY (INTERVAL 1 day))DISTRIBUTED BY HASH(customer_code) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-365",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);


--  Doris 新增字段：
alter table jms_dm.dm_qxt_customer_new_detail_dt
add  column (
virt_code varchar(100) comment'虚拟代理区code',
virt_name varchar(100) comment'虚拟代理区'
  );


--  Doris 新增字段：
alter table jms_dm.dm_qxt_customer_new_detail_dt
add  column (
virt_code varchar(100) comment'虚拟代理区code',
virt_name varchar(100) comment'虚拟代理区'
  );